import request from '@/utils/request'

// 获取结算信息
export const getOrderInfoAPI = () => request({
  url: '/member/order/pre'
})

// 添加收货地址
export const insertAddressAPI = (data) => request({
  url: '/member/address',
  method: 'post',
  data
})

// 查询收货地址
export const getAddressAPI = () => request({
  url: '/member/address'
})

// 修改收货地址
export const updateAddressAPI = (data) => request({
  url: `/member/address/${data.id}`,
  method: 'put',
  data
})

// 创建订单
export const createOrderAPI = (data) => request({
  url: '/member/order',
  method: 'post',
  data
})
